<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>embedme: src/ThreadUtil.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">embedme
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">ThreadUtil.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_thread_util_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/******************************************************************************</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * This file is part of libemb.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * libemb is free software: you can redistribute it and/or modify</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * it under the terms of the GNU General Public License as published by</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * the Free Software Foundation, either version 3 of the License, or</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * (at your option) any later version.</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * libemb is distributed in the hope that it will be useful,</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * GNU General Public License for more details.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * You should have received a copy of the GNU General Public License</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * along with libemb.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * Project: Embedme</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * Author : FergusZeng</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * Email  : cblock@126.com</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * git    : https://gitee.com/newgolo/embedme.git</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> * Copyright 2014~2020 @ ShenZhen ,China</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">*******************************************************************************/</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#ifndef __THREAD_SYNC_H__</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#define __THREAD_SYNC_H__</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="_base_type_8h.html">BaseType.h</a>&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &lt;fcntl.h&gt;</span>           <span class="comment">/* For O_* constants */</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &lt;sys/stat.h&gt;</span>        <span class="comment">/* For mode constants */</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &lt;semaphore.h&gt;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &lt;pthread.h&gt;</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &lt;queue&gt;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160; </div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="keyword">namespace </span>libemb{</div>
<div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="classlibemb_1_1_mutex.html">   43</a></span>&#160;<span class="keyword">class </span><a class="code" href="classlibemb_1_1_mutex.html">Mutex</a>{</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;    <a class="code" href="classlibemb_1_1_mutex.html">Mutex</a>();</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;    ~<a class="code" href="classlibemb_1_1_mutex.html">Mutex</a>();</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_mutex.html#a05691334e33086ce5e2155d8082fba60">lock</a>();</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_mutex.html#a8ff4ef59bf0b51a1477678d78f5ecb4a">unLock</a>();</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_mutex.html#a57785fab2eadfa4bd7012fd4b44010ce">tryLock</a>();</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    pthread_mutex_t m_mutex;</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classlibemb_1_1_mutex_cond.html">MutexCond</a>;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;};</div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="classlibemb_1_1_auto_lock.html">   70</a></span>&#160;<span class="keyword">class </span><a class="code" href="classlibemb_1_1_auto_lock.html">AutoLock</a>{</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <a class="code" href="classlibemb_1_1_auto_lock.html">AutoLock</a>(<a class="code" href="classlibemb_1_1_mutex.html">Mutex</a>&amp; mutex);</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="classlibemb_1_1_auto_lock.html">AutoLock</a>();</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <a class="code" href="classlibemb_1_1_mutex.html">Mutex</a>* m_pMutex;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;};</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160; </div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="classlibemb_1_1_mutex_cond.html">   82</a></span>&#160;<span class="keyword">class </span><a class="code" href="classlibemb_1_1_mutex_cond.html">MutexCond</a> : <span class="keyword">public</span> <a class="code" href="classlibemb_1_1_mutex.html">Mutex</a>{</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <a class="code" href="classlibemb_1_1_mutex_cond.html">MutexCond</a>();</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    ~<a class="code" href="classlibemb_1_1_mutex_cond.html">MutexCond</a>();</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_mutex_cond.html#a0d038456e6c24f7621f47deec97e9e31">wait</a>(<span class="keywordtype">int</span> usec=-1);</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="classlibemb_1_1_mutex_cond.html#a66ed5d2571fba8731139e51c90ada598">meet</a>();</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    pthread_cond_t m_cond;</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    pthread_condattr_t m_condAttr;</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;};</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160; </div>
<div class="line"><a name="l00118"></a><span class="lineno"><a class="line" href="classlibemb_1_1_semaphore.html">  118</a></span>&#160;<span class="keyword">class </span><a class="code" href="classlibemb_1_1_semaphore.html">Semaphore</a>{</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<a class="code" href="_base_type_8h.html#a57e803e49526dc5ba8c1915c68708ae0">DECL_CLASSNAME</a>(<a class="code" href="classlibemb_1_1_semaphore.html">Semaphore</a>)</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <a class="code" href="classlibemb_1_1_semaphore.html#a53bb52d22ce9e0ecc2fad6a2832dd426">Semaphore</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* name=NULL);</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    ~<a class="code" href="classlibemb_1_1_semaphore.html">Semaphore</a>();</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_semaphore.html#a363fad413d5fbe26a8c6bdf267fc5fd1">open</a>(<span class="keywordtype">int</span> value=-1);</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_semaphore.html#a30b722f5f9e6f6a867abdc62efd1629d">close</a>();</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_semaphore.html#a866dd6c3990e301ac10ddfedc4eae767">unlink</a>();</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_semaphore.html#ab2da514c4f3d69cbb985c54a389c6cec">wait</a>();</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_semaphore.html#a37cbf6ce273d11ae0854d624c47ba8e8">tryWait</a>();</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_semaphore.html#ae25af7e2a288cf351cd20de525d07f47">post</a>();</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_semaphore.html#a72ccf6c042741028774e20d9e2d38281">getValue</a>(<span class="keywordtype">int</span>&amp; value);</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    sem_t m_sem;</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    std::string m_name;</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;};</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160; </div>
<div class="line"><a name="l00187"></a><span class="lineno"><a class="line" href="classlibemb_1_1_semaphore_v.html">  187</a></span>&#160;<span class="keyword">class </span><a class="code" href="classlibemb_1_1_semaphore_v.html">SemaphoreV</a>{</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;<a class="code" href="_base_type_8h.html#a57e803e49526dc5ba8c1915c68708ae0">DECL_CLASSNAME</a>(<a class="code" href="classlibemb_1_1_semaphore_v.html">SemaphoreV</a>)</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    <a class="code" href="classlibemb_1_1_semaphore_v.html">SemaphoreV</a>();</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;    ~<a class="code" href="classlibemb_1_1_semaphore_v.html">SemaphoreV</a>();</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_semaphore_v.html#a952a2c74edfd20ed6a8017600c13bc26">open</a>(<span class="keywordtype">int</span> key);</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classlibemb_1_1_semaphore_v.html#af2036c7ffca9f9f3cc5b7f01b2472053">close</a>();</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_semaphore_v.html#a795775271a4885b20fae963b83d8c2fe">wait</a>();</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_semaphore_v.html#a637dde4d39b054e026c1f27324324dc7">post</a>();</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classlibemb_1_1_semaphore_v.html#aaab3ea8ce6c1ad22e34e124878707f58">getValue</a>(<span class="keywordtype">int</span>&amp; value);</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    <span class="keywordtype">int</span> m_sem;      </div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;};</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;}</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160; </div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclasslibemb_1_1_semaphore_html_a30b722f5f9e6f6a867abdc62efd1629d"><div class="ttname"><a href="classlibemb_1_1_semaphore.html#a30b722f5f9e6f6a867abdc62efd1629d">libemb::Semaphore::close</a></div><div class="ttdeci">bool close()</div><div class="ttdoc">关闭信号量</div><div class="ttdef"><b>Definition:</b> ThreadUtil.cpp:216</div></div>
<div class="ttc" id="aclasslibemb_1_1_mutex_html_a8ff4ef59bf0b51a1477678d78f5ecb4a"><div class="ttname"><a href="classlibemb_1_1_mutex.html#a8ff4ef59bf0b51a1477678d78f5ecb4a">libemb::Mutex::unLock</a></div><div class="ttdeci">int unLock()</div><div class="ttdoc">互斥锁解锁</div><div class="ttdef"><b>Definition:</b> ThreadUtil.cpp:70</div></div>
<div class="ttc" id="aclasslibemb_1_1_mutex_html_a05691334e33086ce5e2155d8082fba60"><div class="ttname"><a href="classlibemb_1_1_mutex.html#a05691334e33086ce5e2155d8082fba60">libemb::Mutex::lock</a></div><div class="ttdeci">int lock()</div><div class="ttdoc">互斥锁上锁</div><div class="ttdef"><b>Definition:</b> ThreadUtil.cpp:65</div></div>
<div class="ttc" id="aclasslibemb_1_1_mutex_cond_html_a66ed5d2571fba8731139e51c90ada598"><div class="ttname"><a href="classlibemb_1_1_mutex_cond.html#a66ed5d2571fba8731139e51c90ada598">libemb::MutexCond::meet</a></div><div class="ttdeci">int meet()</div><div class="ttdoc">通知等待者满足条件变量</div><div class="ttdef"><b>Definition:</b> ThreadUtil.cpp:147</div></div>
<div class="ttc" id="aclasslibemb_1_1_semaphore_html_a37cbf6ce273d11ae0854d624c47ba8e8"><div class="ttname"><a href="classlibemb_1_1_semaphore.html#a37cbf6ce273d11ae0854d624c47ba8e8">libemb::Semaphore::tryWait</a></div><div class="ttdeci">bool tryWait()</div><div class="ttdoc">尝试等待信号量</div><div class="ttdef"><b>Definition:</b> ThreadUtil.cpp:260</div></div>
<div class="ttc" id="aclasslibemb_1_1_mutex_html"><div class="ttname"><a href="classlibemb_1_1_mutex.html">libemb::Mutex</a></div><div class="ttdoc">互斥锁类</div><div class="ttdef"><b>Definition:</b> ThreadUtil.h:43</div></div>
<div class="ttc" id="aclasslibemb_1_1_mutex_html_a57785fab2eadfa4bd7012fd4b44010ce"><div class="ttname"><a href="classlibemb_1_1_mutex.html#a57785fab2eadfa4bd7012fd4b44010ce">libemb::Mutex::tryLock</a></div><div class="ttdeci">int tryLock()</div><div class="ttdoc">互斥锁尝试上锁</div><div class="ttdef"><b>Definition:</b> ThreadUtil.cpp:75</div></div>
<div class="ttc" id="aclasslibemb_1_1_semaphore_v_html_a795775271a4885b20fae963b83d8c2fe"><div class="ttname"><a href="classlibemb_1_1_semaphore_v.html#a795775271a4885b20fae963b83d8c2fe">libemb::SemaphoreV::wait</a></div><div class="ttdeci">bool wait()</div><div class="ttdoc">等待信号量</div><div class="ttdef"><b>Definition:</b> ThreadUtil.cpp:334</div></div>
<div class="ttc" id="aclasslibemb_1_1_semaphore_html_ab2da514c4f3d69cbb985c54a389c6cec"><div class="ttname"><a href="classlibemb_1_1_semaphore.html#ab2da514c4f3d69cbb985c54a389c6cec">libemb::Semaphore::wait</a></div><div class="ttdeci">bool wait()</div><div class="ttdoc">等待信号量</div><div class="ttdef"><b>Definition:</b> ThreadUtil.cpp:251</div></div>
<div class="ttc" id="aclasslibemb_1_1_semaphore_html_ae25af7e2a288cf351cd20de525d07f47"><div class="ttname"><a href="classlibemb_1_1_semaphore.html#ae25af7e2a288cf351cd20de525d07f47">libemb::Semaphore::post</a></div><div class="ttdeci">bool post()</div><div class="ttdoc">释放信号量</div><div class="ttdef"><b>Definition:</b> ThreadUtil.cpp:269</div></div>
<div class="ttc" id="aclasslibemb_1_1_semaphore_v_html_af2036c7ffca9f9f3cc5b7f01b2472053"><div class="ttname"><a href="classlibemb_1_1_semaphore_v.html#af2036c7ffca9f9f3cc5b7f01b2472053">libemb::SemaphoreV::close</a></div><div class="ttdeci">void close()</div><div class="ttdoc">关闭信号量</div><div class="ttdef"><b>Definition:</b> ThreadUtil.cpp:327</div></div>
<div class="ttc" id="a_base_type_8h_html"><div class="ttname"><a href="_base_type_8h.html">BaseType.h</a></div><div class="ttdoc">基础类型头文件</div></div>
<div class="ttc" id="aclasslibemb_1_1_semaphore_v_html_aaab3ea8ce6c1ad22e34e124878707f58"><div class="ttname"><a href="classlibemb_1_1_semaphore_v.html#aaab3ea8ce6c1ad22e34e124878707f58">libemb::SemaphoreV::getValue</a></div><div class="ttdeci">bool getValue(int &amp;value)</div><div class="ttdoc">获取信号量值</div><div class="ttdef"><b>Definition:</b> ThreadUtil.cpp:361</div></div>
<div class="ttc" id="aclasslibemb_1_1_semaphore_v_html_a637dde4d39b054e026c1f27324324dc7"><div class="ttname"><a href="classlibemb_1_1_semaphore_v.html#a637dde4d39b054e026c1f27324324dc7">libemb::SemaphoreV::post</a></div><div class="ttdeci">bool post()</div><div class="ttdoc">发送信号量</div><div class="ttdef"><b>Definition:</b> ThreadUtil.cpp:347</div></div>
<div class="ttc" id="aclasslibemb_1_1_semaphore_v_html_a952a2c74edfd20ed6a8017600c13bc26"><div class="ttname"><a href="classlibemb_1_1_semaphore_v.html#a952a2c74edfd20ed6a8017600c13bc26">libemb::SemaphoreV::open</a></div><div class="ttdeci">bool open(int key)</div><div class="ttdoc">打开信号量</div><div class="ttdef"><b>Definition:</b> ThreadUtil.cpp:304</div></div>
<div class="ttc" id="aclasslibemb_1_1_semaphore_html_a72ccf6c042741028774e20d9e2d38281"><div class="ttname"><a href="classlibemb_1_1_semaphore.html#a72ccf6c042741028774e20d9e2d38281">libemb::Semaphore::getValue</a></div><div class="ttdeci">bool getValue(int &amp;value)</div><div class="ttdoc">获取信号量值</div><div class="ttdef"><b>Definition:</b> ThreadUtil.cpp:278</div></div>
<div class="ttc" id="aclasslibemb_1_1_auto_lock_html"><div class="ttname"><a href="classlibemb_1_1_auto_lock.html">libemb::AutoLock</a></div><div class="ttdoc">自动释放的互斥锁类</div><div class="ttdef"><b>Definition:</b> ThreadUtil.h:70</div></div>
<div class="ttc" id="aclasslibemb_1_1_semaphore_html_a866dd6c3990e301ac10ddfedc4eae767"><div class="ttname"><a href="classlibemb_1_1_semaphore.html#a866dd6c3990e301ac10ddfedc4eae767">libemb::Semaphore::unlink</a></div><div class="ttdeci">bool unlink()</div><div class="ttdoc">删除信号量</div><div class="ttdef"><b>Definition:</b> ThreadUtil.cpp:238</div></div>
<div class="ttc" id="aclasslibemb_1_1_mutex_cond_html_a0d038456e6c24f7621f47deec97e9e31"><div class="ttname"><a href="classlibemb_1_1_mutex_cond.html#a0d038456e6c24f7621f47deec97e9e31">libemb::MutexCond::wait</a></div><div class="ttdeci">int wait(int usec=-1)</div><div class="ttdoc">等待条件变量</div><div class="ttdef"><b>Definition:</b> ThreadUtil.cpp:107</div></div>
<div class="ttc" id="a_base_type_8h_html_a57e803e49526dc5ba8c1915c68708ae0"><div class="ttname"><a href="_base_type_8h.html#a57e803e49526dc5ba8c1915c68708ae0">DECL_CLASSNAME</a></div><div class="ttdeci">#define DECL_CLASSNAME(ClassName)</div><div class="ttdef"><b>Definition:</b> BaseType.h:176</div></div>
<div class="ttc" id="aclasslibemb_1_1_semaphore_html"><div class="ttname"><a href="classlibemb_1_1_semaphore.html">libemb::Semaphore</a></div><div class="ttdoc">信号量类(基于POSIX接口)</div><div class="ttdef"><b>Definition:</b> ThreadUtil.h:118</div></div>
<div class="ttc" id="aclasslibemb_1_1_mutex_cond_html"><div class="ttname"><a href="classlibemb_1_1_mutex_cond.html">libemb::MutexCond</a></div><div class="ttdoc">条件变量</div><div class="ttdef"><b>Definition:</b> ThreadUtil.h:82</div></div>
<div class="ttc" id="aclasslibemb_1_1_semaphore_v_html"><div class="ttname"><a href="classlibemb_1_1_semaphore_v.html">libemb::SemaphoreV</a></div><div class="ttdoc">信号量类(基于systemV接口)</div><div class="ttdef"><b>Definition:</b> ThreadUtil.h:187</div></div>
<div class="ttc" id="aclasslibemb_1_1_semaphore_html_a363fad413d5fbe26a8c6bdf267fc5fd1"><div class="ttname"><a href="classlibemb_1_1_semaphore.html#a363fad413d5fbe26a8c6bdf267fc5fd1">libemb::Semaphore::open</a></div><div class="ttdeci">bool open(int value=-1)</div><div class="ttdoc">打开信号量</div><div class="ttdef"><b>Definition:</b> ThreadUtil.cpp:169</div></div>
<div class="ttc" id="aclasslibemb_1_1_semaphore_html_a53bb52d22ce9e0ecc2fad6a2832dd426"><div class="ttname"><a href="classlibemb_1_1_semaphore.html#a53bb52d22ce9e0ecc2fad6a2832dd426">libemb::Semaphore::Semaphore</a></div><div class="ttdeci">Semaphore(const char *name=NULL)</div><div class="ttdoc">信号量</div><div class="ttdef"><b>Definition:</b> ThreadUtil.cpp:153</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
</html>
